home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: nanninr@ix.netcom.com(Robert A. Nannini )
- Newsgroups: comp.lang.c++
- Subject: Re: Borland C++ v4.0 (Windows) Container classes
- Date: 3 Jan 1996 16:35:20 GMT
- Organization: Netcom
- Message-ID: <4ceb88$i8o@cloner2.ix.netcom.com>
- References: <4cd20q$1h3e@news-s01.ny.us.ibm.net>
- NNTP-Posting-Host: ix-stl4-13.ix.netcom.com
- X-NETCOM-Date: Wed Jan 03 8:35:20 AM PST 1996
-
- In <4cd20q$1h3e@news-s01.ny.us.ibm.net> zingg@ibm.net writes:
- >
- >I am writing a small Windows program that uses the dictionary
- container class in Borland C++ v4.0. I have part of the application in
- a DLL. As soon as I placed the source file that contained the
- container class logic in the DLL, the program stopped working.
- >The program links correctly and everything, however, when I run the
- program it terminates immediately with a normal return code. If I use
- the Turbo Debugger, the program terminates before even reaching the
- first line of code. My only guess is that
- >there is some sort of option or something I need to invoke that will
- allow the container class to be used in a DLL. Maybe something in the
- function resolution when my program attempts to bind with the dll is
- causing the program termination? Does anyone
- >have any idea on what is happening or how I can possibly fix it?
- >
- >thank you
-
- Borland 4.0 has a bug in their handling of templates within and among
- dll's. We ran into this problem while attempting to pass a
- TArrayAsVector between a .dll and an .exe. What we did was the
- following, as prescribed by Borland:
-
- ----------
- class _export MyClass {
- public:
- MyClass();
- };
-
- #pragma option -Jgd
-
- //array of MyClass
- typedef TArrayAsVector<MyClass> tMyArray;
- class MyArray : public tMyArray {
- public:
- MyArray() : tMyArray(3, 0, 3) {}
- };
-
- #pragma option -Jgx
- ----------
-
- As you can see, at the end of all this you have a class with all the
- functionality of Borland's TArray class, plus the ability to pass it as
- you would anything else. Hope this helps.
-
- bob
- nanninr@ix.netcom.com
-